home *** CD-ROM | disk | FTP | other *** search
/ Larry Magid's Essential Internet / Larry Magid's Essential Internet (Quarterdeck Corporation)(1995).ISO / qsockpro.qip / CHARMNET.MPS < prev    next >
Text File  |  1995-10-09  |  2KB  |  69 lines

  1. # Charm Net PPP and SLIP login script
  2. # Copyright 1995 Quarterdeck Corporation
  3. # 5-9-95 CEL
  4.  
  5. STRING username
  6. STRING password
  7. STRING framing
  8. STRING IPAddress
  9.      
  10. SetTimeOut  60
  11. CfgGetValue "Username" username
  12.  
  13. IF result = 0 THEN
  14.     GetInput "Enter your username:"  username
  15.     IF result = 0 THEN
  16.         PRINT "Warning, no username entered."
  17.     ELSE
  18.         PRINT "Username set to: ";username
  19.     ENDIF
  20. ENDIF
  21.     
  22. CfgGetValue "Password" password
  23. IF result = 0 THEN
  24.     GetPassword "Enter your password:" password
  25.     IF result = 0 THEN
  26.         PRINT "Warning, no password entered."
  27.     ELSE
  28.         PRINT "Password set."
  29.     ENDIF
  30. ENDIF
  31.     
  32. CfgGetValue "Framing" framing
  33. IF result = 0 THEN
  34.     ABORT "Can't read 'Framing' setting from QDECK.INI."
  35. ENDIF                    # don't wait for spaces
  36.  
  37. CommSend    "%r"        # prod the server
  38. CommWaitFor "login:"    # not case sensitive
  39.  
  40. # The character before the user name indicates the type of connection.
  41. IF framing = "MPPPP" THEN
  42.     CommSend   "P"
  43. ENDIF
  44. IF framing = "MPSLIP" THEN
  45.     CommSend   "S"
  46. ENDIF                
  47.  
  48. CommSend        username
  49. CommSend        "%r"            # send ENTER
  50.     
  51. CommWaitFor     "password:"
  52.     CommSend        password
  53.     CommSend        "%r"
  54.     
  55. IF framing = "MPSLIP" THEN
  56.     PRINT "%rGetting IP Address for SLIP"
  57.     CommWaitFor ") to"
  58.     CommReadIPAddr IPAddress
  59.  
  60.     IF result < 7 THEN            # IP Address length test
  61.         ABORT "Invalid IP Address"
  62.     ENDIF
  63.  
  64.     CfgSetValue "IPAddress" ipaddress
  65.     PRINT "%rIP Address set to "; ipaddress
  66. ENDIF
  67.     
  68. END
  69.